<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Product Page - Ustora Demo</title>
    
    <!-- Google Fonts -->
    <link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,200,300,700,600' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Raleway:400,100' rel='stylesheet' type='text/css'>
    
    <!-- Bootstrap -->
    <link rel="stylesheet" href="${request.contextPath}/css/bootstrap.min.css">
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${request.contextPath}/css/font-awesome.min.css">
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="${request.contextPath}/css/owl.carousel.css">
    <link rel="stylesheet" href="${request.contextPath}/style.css">
    <link rel="stylesheet" href="${request.contextPath}/css/responsive.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
   
    <div class="header-area">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <div class="user-menu">
                        <ul>
                            <li><a href="http://localhost:8010/shophome1"><i class="fa fa-user"></i>主页</a></li>
                            <li><a href="http://localhost:8010/person"><i class="fa fa-heart"></i>个人中心</a></li>
                            <li><a href="http://localhost:8010/cart"><i class="fa fa-user"></i>购物车</a></li>
                            <li><a href="http://localhost"><i class="fa fa-user"></i>登录</a></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
    </div> <!-- End header area -->
    


    
    <div class="product-big-title-area">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="product-bit-title text-center">
                        <h2>详细信息</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    
    <div class="single-product-area">
        <div class="zigzag-bottom"></div>
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <div class="single-sidebar">
                        <h2 class="sidebar-title">搜索商品</h2>
                        <form action="">
                            <input type="text" placeholder="Search products...">
                            <input type="submit" value="Search">
                        </form>
                    </div>
                </div>

                <div class="col-md-8">
                    <div class="product-content-right">

                        <div class="row">
                            <div class="col-sm-6">
                                <div class="product-images">
                                    <div class="product-main-img">
                                        <img src="${request.contextPath}/img/product-2.jpg" alt="">
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-6">
                                <div class="product-inner">
                                    <h2 class="product-name">${item.itemname}</h2>
                                    <div class="product-inner-price">
                                        <ins>￥${item.price}</ins>
                                    </div>

                                    <form id="formsunmit" name="formsunmit">
                                        <div class="quantity">
                                            <input type="number" size="4" class="input-text qty text" title="Qty" value="1" name="countss" id = "countss" min="1" step="1">
                                            <input type="hidden" value="${item.iid}" id = "iid" name="iid">
                                        </div>
                                        <button class="add_to_cart_button" onclick="submitform()">加入购物车</button>
                                    </form>

                                    <script src = "${request.contextPath}/js/jquery-1.11.0.js"></script>
                                    <script>
                                        function submitform(){
                                            var formData = new FormData($("#formsunmit")[0]);//用form 表单直接 构造formData 对象; 就不需要下面的append 方法来为表单进行赋值了。
                                            $.ajax({
                                                async: false,
                                                url : "/addform",
                                                type : 'POST',
                                                data : formData,
                                                processData : false,  //必须false才会避开jQuery对 formdata 的默认处理
                                                contentType : false,  //必须false才会自动加上正确的Content-Type
                                                success : function(result) {
                                                    alert(result);
                                                }
                                            });
                                        }
                                    </script>
                                    <br><br>
                                    <div role="tabpanel">
                                        <ul class="product-tab" role="tablist">
                                            <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">描述</a></li>
                                            <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">反馈</a></li>
                                        </ul>
                                        <div class="tab-content">
                                            <div role="tabpanel" class="tab-pane fade in active" id="home">
                                                <h2>商品描述</h2>
                                                <p>名称:${item.itemname}</p><br>
                                                <p>价格:${item.price}</p><br>
                                                <p>库存:${item.counts}</p><br>
                                                <p>品牌:${item.brand}</p><br>
                                                <p>生产日期:${item.PD}</p><br>
                                                <p>图片:${item.picture}</p><br>
                                            </div>
                                            <div role="tabpanel" class="tab-pane fade" id="profile">
                                                <h2>反馈</h2>
                                                <div class="submit-review">
                                                    <p><label for="name">姓名</label> <input name="name" type="text"></p>
                                                    <p><label for="email">Email</label> <input name="email" type="email"></p>
                                                    <p><label for="review">你的反馈</label> <textarea name="review" id="" cols="30" rows="10"></textarea></p>
                                                    <p><input type="submit" value="提交"></p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Latest jQuery form server -->
    <script src="https://code.jquery.com/jquery.min.js"></script>
    
    <!-- Bootstrap JS form CDN -->
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    
    <!-- jQuery sticky menu -->
    <script src="js/owl.carousel.min.js"></script>
    <script src="js/jquery.sticky.js"></script>
    
    <!-- jQuery easing -->
    <script src="js/jquery.easing.1.3.min.js"></script>
    
    <!-- Main Script -->
    <script src="js/main.js"></script>
  </body>
</html>